/*
 * K2SComparator.h
 *
 *  Created on: 13-09-2013
 *      Author: Krzychu
 */

#ifndef K2SCOMPARATOR_H_
#define K2SCOMPARATOR_H_

#include "IAlgorithm.h"
#include "CompareResult.h"
#include "CompareMetricSource.h"
#include "CompareMetricTarget.h"

class K2SComparator
{
public:
	K2SComparator(IAlgorithm* searchAlgorithm);
	virtual ~K2SComparator();
	void execute(std::string source, std::string result);
	void execute(std::string source, std::vector<std::string> results);

	CompareMetricSource* getSourceMetrics();
	CompareMetricTarget* getTargetMetrics();

	vector<string> findExactMatches(int minWordCount, int maxWordCount);
private:
	CompareMetricSource* sourceMetric;
	CompareMetricTarget* targetMetric;
	CompareResult result;
	IAlgorithm* searchAlgorithm;

	void generateSourceMetrics(std::string source);
	void generateTargetMetrics(std::string target);
	void splitWords(std::string string, CompareMetric* metric);
};

#endif /* K2SCOMPARATOR_H_ */
